The Postman Always Rings Twice: Attacking and Defending postMessage in HTML5 Websites
نویسندگان
چکیده
The postMessage mechanism in HTML5 enables Web content from different origins to communicate with each other, thus relaxing the same origin policy. It is especially popular in websites that include third-party content. Each message contains accurate information about its origin, but the receiver must check this information before accepting the message. The responsibility for preventing cross-origin attacks is thus partially delegated from the Web browser to the implementors of postMessage receiver functions. We collected postMessage receivers from the Alexa top 10,000 websites and found that many perform origin checks incorrectly or not at all. This results in exploitable vulnerabilities in 84 popular sites, including cross-site scripting and injection of arbitrary content into local storage. We propose two defenses. The first uses pseudo-random tokens to authenticate the source of messages and is intended for the implementors of third-party content. The second, based on a Content Security Policy extension, is intended for website owners. The two defenses are independent and can be deployed jointly or separately.
منابع مشابه
Study and Mitigation of Origin Stripping Vulnerabilities in Hybrid-postMessage Enabled Mobile Applications
postMessage is popular in HTML5 based web apps to allow the communication between different origins. With the increasing popularity of the embedded browser (i.e., WebView) in mobile apps (i.e., hybrid apps), postMessage has found utility in these apps. However, different from web apps, hybrid apps have a unique requirement that their native code (e.g., Java for Android) also needs to exchange m...
متن کاملThe Emperor’s New APIs: On the (In)Secure Usage of New Client-side Primitives
Several new browser primitives have been proposed to meet the demands of application interactivity while enabling security. To investigate whether applications consistently use these primitives safely in practice, we study the real-world usage of two client-side primitives, namely postMessage and HTML5’s client-side database storage. We examine new purely client-side communication protocols lay...
متن کاملOffensive Positioning Based on Maximum Weighted Bipartite Matching and Voronoi Diagram
In this paper we propose a modification to the well known Delaunay Triangulation based positioning in the attacking situation positioning of the agents in 2D Soccer Simulation environment. Due to advanced defensive skills such as marking skill, the attacker agents should have a dynamic positioning with respect to the rival team defenders. The proposed method employs the vertices of the Voronoi ...
متن کاملA Study of Web Accessibility of Websites Built in HTML5 - Focusing on the Top 100 Most Visited Websites -
HTML5 is the next generation of web standards, and needs to be used to improve Web accessibility. To do this, Korea has taken various activities, such as laying down laws and standards related to web accessibility and investigating the realities of web accessibility. Recently, the market for web accessibility has been growing. This study compared the rates of building up HTML5, focusing on the ...
متن کاملMachine Learning in the Presence of an Adversary: Attacking and Defending the SpamBayes Spam Filter
Machine Learning in the Presence of an Adversary: Attacking and Defending the SpamBayes Spam Filter
متن کامل